home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 179 / 179.d81 / green flash (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  240 lines

  1. 5 poke55,.:poke56,56:clr
  2. 10 dv=peek(186):ifdv<8thendv=8
  3. 15 poke53280,0:poke53281,0:print"[147]"
  4. 16 poke53371,0
  5. 25 poke53272,31
  6. 30 ad=49152
  7. 35 sysad:sysad+12
  8. 40 bx$="[159][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180]
  9. 42 [153]"loadopen(NULL)andandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandand(NULL)":[158]ad[170]9,15
  10. 44 [153]bx$"";[163]38)bx$
  11. 45 lc[178]0
  12. 46 [153]"open(NULL)andandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandandnot"
  13. 49 [153]"":[153][163]1)"print     (NULL)left$val chr$(NULL)valval(NULL) asc(NULL)atn(NULL)left$ lenatn(NULL)len(NULL)(NULL)atn(NULL)(NULL)(NULL)!     "
  14. 50 [143] the green flash
  15. 55 :
  16. 60 [153][163]2)"contleft$eight of (NULL)bserver sysft ";:l9%[178]8:[141]1040:h[178]q9
  17. 65 [153][163]2)"cont(NULL)enith dist. (NULL)cculting edge sys((NULL)) ";:l9%[178]3:[141]1040:z0[178]q9
  18. 70 [153][163]2)"contatnerosol valxtinction sys(haziness) ";:l9%[178]4:[141]1040:kd[178]q9
  19. 75 [153][163]2)"cont(NULL)ccult sys(peek)contottom or sys((NULL))contop of (NULL)un: ":[151]198,.
  20. 80 [161]a$:[139]a$[179][177]"t"[175]a$[179][177]"b"[167]80
  21. 82 [139]a$[178]"t"[167]tb[178][171]1:[158]ad[170]9,16:[137]85
  22. 84 tb[178]1:[158]ad[170]9,16
  23. 85 [153]:[141]830
  24. 90 ds[178]1:[143] sun's dist in a.u.
  25. 95 rs[178]1:[143] sun's radius in solar radii
  26. 100 ts[178]5700:[143] readun's temp kelvin
  27. 105 d[178]0:[143] sun's declination in degrees
  28. 110 mp[178]1:[143] planet's mass in earth masses
  29. 115 pe[178]1:[143] planet's rotation period in days
  30. 120 r0[178]1:[143] planet's radius in earth radii
  31. 125 [153][163]2)"cont(NULL)our (NULL)atitude: ";:l9%[178]6:[141]1040:l[178]q9
  32. 130 p[178]1:[143] sea-level pressure bars
  33. 135 [153][163]2)"contlenurrent (NULL)emperature sys(asc(NULL)): ";:l9%[178]3:[141]1040:ct[178]q9
  34. 137 t0[178]ct[171]32[172]5[173]9
  35. 140 oz[178]3:[143] ozone layer thickness (mm at stp)
  36. 142 [153]:[153][163]5)"right$s (NULL)his lenorrect? open(NULL)/(NULL)":[151]198,.
  37. 143 [161]a$:[139]a$[179][177]"y"[175]a$[179][177]"n"[167]143
  38. 144 [139]a$[178]"n"[167]42
  39. 145 hs[178]12:[143] ozone ht. (miles above sea level)
  40. 148 [153]"load":[153][163]3)"lenatn(NULL)len(NULL)(NULL)atn(NULL)right$(NULL)chr$... (NULL)ne (NULL)oment!":[158]ad[170]9,17
  41. 150 aa[178][171]1.3:[143] aerosol exponent (unitless)
  42. 155 ah[178]1:[143] aerosol scale height (miles)
  43. 160 pp(1)[178]78:[143] nitrogen % by volume
  44. 165 pp(2)[178]22:[143] oxygen percent
  45. 170 pp(3)[178]0:[143] carbon dioxide
  46. 175 pp(4)[178]0:[143] hydrogen
  47. 180 pp(5)[178]0:[143] helium
  48. 185 pp(6)[178]0:[143] methane
  49. 190 pp(7)[178]0:[143] ammonia
  50. 195 pp(8)[178]0:[143] argon
  51. 200 :
  52. 205 [143] convert input data to cgs units
  53. 210 ds[178]ds[172]1.496e[170]13:rs[178]rs[172]6.96e[170]10
  54. 215 r0[178]r0[172]6.378e[170]8:h[178]h[172]30.48
  55. 220 hs[178]hs[172]1.609e[170]5:ah[178]ah[172]1.609e[170]5
  56. 225 d[178]d[172]pi[173]180:l[178]l[172]pi[173]180:z0[178]z0[172]pi[173]180
  57. 230 mp[178]mp[172]5.976e[170]27
  58. 235 pe[178]pe[172]24[172]3600
  59. 240 t0[178]t0[170]273.1
  60. 245 [158]ad[170]9,17
  61. 250 [143] calcuate average molecular weight
  62. 255 mw[178]0
  63. 260 [129]ig[178]1[164]8:mw[178]mw[170]mx(ig)[172]pp(ig)[172].01:[130]ig
  64. 265 :
  65. 270 [143] calcuate atmospheric parameters
  66. 275 g[178]6.67e[171]8[172]mp[172](r0[174][171]2)
  67. 280 s[178]8.31e[170]7[172]t0[173](g[172]mw)
  68. 285 la[178][171].4[172]t0[173]s
  69. 290 :
  70. 295 [143] choose a color
  71. 300 [129]ic[178]1[164]11
  72. 305 w[178](ic[172]500[170]2500)[172]1e[171]8
  73. 310 [143] calcuate index of refraction
  74. 315 n0[178]0
  75. 320 [129]ig[178]1[164]8
  76. 325 ns[178](a(ig)[172].00001)[172](1[170](b(ig)[172]1e[171]11)[173](w[174]2))
  77. 330 n0[178]n0[170]ns[172]pp(ig)[172].01[172]p[172]273.1[173]t0
  78. 335 [130]ig
  79. 340 n[178]1[170]n0[172][189]([171]h[173]s)
  80. 345 n0[178]n0[170]1
  81. 350 :
  82. 355 [143] cal refraction & air mass for each color
  83. 360 [141]795
  84. 365 [139]rf[177]rx[167]rx[178]rf
  85. 370 [139]rf[179]rn[167]rn[178]rf
  86. 375 r(ic)[178]rf:xr[178]am
  87. 380 [158]ad[170]9,17
  88. 385 [143] calc air transmission at occulting object
  89. 390 kr[178]1.13e[171]11[172]((n[171]1)[174]2)[172](w[174][171]4)
  90. 395 ka[178]kd[172]((w[173].000055)[174]aa):cz[178][190](z0)
  91. 400 xa[178]1[173](cz[170].8[172][186](ah[173]r0)[172][189]([171].38[172]cz[172][186](r0[173]ah)))
  92. 405 k0[178]ks(ic)[172]oz[173]3
  93. 410 x0[178]1[173][186](1[171]([191](z0)[173](1[170]((hs[171]h)[173]r0)))[174]2)
  94. 415 kx[178]kr[172]xr[170]ka[172]xa[170]k0[172]x0:[139]kx[177]90[167]kx[178]90
  95. 420 tr(ic)[178]10[174]([171].4[172]kx)
  96. 425 :
  97. 430 [143] calculate sun's flux above atmosphere
  98. 435 bb[178].0000374[172](w[174][171]5)[173]([189](1.43[173](w[172]ts))[171]1)
  99. 440 fa(ic)[178]((rs[173]ds)[174]2)[172]bb[172]1e[171]8
  100. 445 [130]ic
  101. 450 [158]ad[170]9,17
  102. 455 [143] pick relevant timr range for calc
  103. 460 cz[178][190](z0[170]rn[170]tb[172]rs[173]ds)
  104. 465 hc[178](cz[171][191](d)[172][191](l))[173]([190](d)[172][190](l))
  105. 470 ha[178][193]([186](1[171]hc[172]hc)[173]hc):[139]hc[179]0[167]ha[178]ha[170]pi
  106. 475 t1[178]ha[172]pe[172].5[173]pi
  107. 480 cz[178][190](z0[170]rx[170]tb[172]rs[173]ds)
  108. 485 hc[178](cz[171][191](d)[172][191](l))[173]([190](d)[172][190](l))
  109. 490 ha[178][193]([186](1[171]hc[172]hc)[173]hc):[139]hc[179]0[167]ha[178]ha[170]pi
  110. 495 t2[178]ha[172]pe[172].5[173]pi
  111. 500 dt[178](t2[171]t1)[173]50
  112. 505 t0[178]t1[171]dt
  113. 510 [153]"loadclr len(NULL)for(NULL)sys(NULL)print(NULL)cont(NULL)- wait   sys (NULL)ime- "
  114. 515 [153]"print    -(NULL)-wait        -(NULL)-wait       -(NULL)-mag. "
  115. 520 [143] main loop starts here
  116. 525 [129]it[178][171]1[164]19
  117. 530 t[178]t1[170]it[172]dt
  118. 535 tt[178]t[171]t0
  119. 540 :
  120. 545 [143] cycle through wavelengths
  121. 550 [129]ic[178]1[164]11
  122. 555 [143] calc altitude of the solar disk for that color
  123. 560 ha[178]2[172]pi[172]t[173]pe
  124. 565 cz[178][191](d)[172][191](l)[170][190](d)[172][190](l)[172][190](ha)
  125. 570 za[178][193]([186](1[171]cz[172]cz)[173]cz):[139]cz[179]0[167]za[178]za[170]pi
  126. 575 za[178]za[171]r(ic)
  127. 580 :
  128. 585 [143] calc the fraction of disk visible
  129. 590 cc[178](za[171]z0)[172]tb[172]ds[173]rs
  130. 595 [139]cc[177]1[167]cc[178]1
  131. 600 th(ic)[178][193]([186](1[171]cc[172]cc)[173]cc)
  132. 605 [139]cc[179]0[167]th(ic)[178]th(ic)[170]pi
  133. 610 fr[178](th(ic)[171]cc[172][191](th(ic)))[173]pi
  134. 615 :
  135. 620 [143] calc visible flux from sun
  136. 625 f(ic)[178]fa(ic)[172]tr(ic)[172]fr
  137. 630 [130]ic
  138. 635 :
  139. 640 [143] could print out flux f(ic) [erg/cm2/s/a]
  140. 645 [143] as well as the sun's stellar magnitude
  141. 650 [143] m(ic)=-2.5*log(f(ic))/b0-(m0(ic)+20)
  142. 655 [143] as a function of the color ic where
  143. 660 [143] 1=3000a, 2=3500a, 3=4000a, ...., 11=8000a
  144. 665 :
  145. 670 xx[178]0:yy[178]0:zz[178]0
  146. 675 [129]ic[178]1[164]11
  147. 680 xx[178]xx[170]x1(ic)[172]f(ic)
  148. 685 yy[178]yy[170]y1(ic)[172]f(ic)
  149. 690 zz[178]zz[170]z1(ic)[172]f(ic)
  150. 695 [130]ic
  151. 700 [139]xx[170]yy[170]zz[178]0[167]780
  152. 705 x[178]xx[173](xx[170]yy[170]zz)
  153. 710 y[178]yy[173](xx[170]yy[170]zz)
  154. 715 [139]y[179].01[167]780
  155. 720 ph[178][193]((.333[171]x)[173](y[171].333))
  156. 725 [139](y[171].333)[179]0[167]ph[178]ph[170]pi
  157. 730 co$[178]"clr (NULL)right$(NULL)(NULL)val(NULL) "
  158. 735 [139]ph[179]4.229[167]co$[178]"cont peek(NULL)(NULL)val "
  159. 740 [139]ph[179]2.580[167]co$[178]"print chr$(NULL)valval(NULL) "
  160. 745 [139]ph[179]1.106[167]co$[178]"sys (NULL)val(NULL)(NULL)(NULL)(NULL) "
  161. 750 [139]ph[179].359[167]co$[178]"for (NULL)(NULL)atn(NULL)chr$val "
  162. 755 [139]ph[179]0.000[167]co$[178]" (NULL)valstr$ "
  163. 760 v[178][171]2.5[172][188](.034[172]yy[173]2.54e[171]10)[173]b0
  164. 765 [153]co$,tt
  165. 770 [153]x;y;v:[158]ad[170]9,18
  166. 775 lc[178]lc[170]1:[139]lc[178][177]10[167][141]1100
  167. 780 [130]it
  168. 785 [141]3000
  169. 790 [153]"load":[137]42
  170. 795 [143] refraction subroutine (quick version)
  171. 800 n[178]1[170](n0[171]1)[172][189]([171]h[173]s)
  172. 805 bs[178]r0[172][191](z0)[173](r0[170].5[172]s):be[178][193](bs[173][186](1[171]bs[172]bs))
  173. 810 r5[178]n[172]bs:rf[178][193](r5[173][186](1[171]r5[172]r5))[171]be:cz[178][190](z0)
  174. 815 am[178]1[173](cz[170].8[172][186](s[173]r0)[172][189]([171].38[172]cz[172][186](r0[173]s)))
  175. 820 [142]
  176. 825 :
  177. 830 [143] constants and data statements
  178. 835 rx[178][171]1:rn[178]1
  179. 840 pi[178][255]:b0[178][188](10)
  180. 845 [134]a(8),b(8),pp(8),mx(8),ks(11),m0(11